home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / makecontext.z / makecontext
Encoding:
Text File  |  1998-10-20  |  6.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. mmmmaaaakkkkeeeeccccoooonnnntttteeeexxxxtttt((((3333CCCC))))                                                mmmmaaaakkkkeeeeccccoooonnnntttteeeexxxxtttt((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt, _ssss_wwww_aaaa_pppp_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt - manipulate user contexts
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt_...._hhhh_>>>>
  13.  
  14.      _vvvv_oooo_iiii_dddd _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt _((((_uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt _****_u_c_p_,,,, _((((_vvvv_oooo_iiii_dddd_((((_****_))))_((((_))))_))))_f_u_n_c_,,,, _iiii_nnnn_tttt _a_r_g_c_,,,,_...._...._...._))))_;;;;
  15.  
  16.      _iiii_nnnn_tttt _ssss_wwww_aaaa_pppp_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt _((((_uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt _****_o_u_c_p_,,,, _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt _****_u_c_p_))))_;;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      These functions are useful for implementing user-level context switching
  20.      between multiple threads of control within a process.
  21.  
  22.      _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt modifies the context specified by _u_c_p, which has been
  23.      initialized using _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt; when this context is resumed using
  24.      _ssss_wwww_aaaa_pppp_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt or _ssss_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt [see _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(2)], program execution
  25.      continues by calling the function _f_u_n_c, passing it the arguments that
  26.      follow _a_r_g_c in the _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt call.  Before a call is made to
  27.      _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt, the context being modified should have a stack allocated for
  28.      it.  The integer value of _a_r_g_c must match the number of arguments that
  29.      follow _a_r_g_c.  Otherwise the behavior is undefined.
  30.  
  31.      The _uuuu_cccc______llll_iiii_nnnn_kkkk field is used to determine the context that will be resumed
  32.      when the context being modified by _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt returns. The _uuuu_cccc______llll_iiii_nnnn_kkkk field
  33.      should be initialized prior to the call to _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt.
  34.  
  35.      _ssss_wwww_aaaa_pppp_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt saves the current context in the context structure pointed to
  36.      by _o_u_c_p and sets the context to the context structure pointed to by _u_c_p.
  37.  
  38.      These functions will fail if either of the following is true:
  39.  
  40.      _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM         _u_c_p does not have enough stack left to complete the
  41.                     operation.
  42.  
  43.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT         _u_c_p or _o_u_c_p points to an invalid address.
  44.  
  45. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  46.      _eeee_xxxx_iiii_tttt(2), _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(2), _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2), _ssss_iiii_gggg_pppp_rrrr_oooo_cccc_mmmm_aaaa_ssss_kkkk(2), _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(5).
  47.  
  48. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  49.      On successful completion, _ssss_wwww_aaaa_pppp_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt return a value of zero.  Otherwise,
  50.      a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  51.  
  52. BBBBUUUUGGGGSSSS
  53.      Due to the procedure calling conventions on the MIPS processor and
  54.      restrictions of _ssss_tttt_dddd_aaaa_rrrr_gggg(5), the arguments that follow the _a_r_g_c parameter
  55.      for _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt are restricted to longs and pointers only.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mmmmaaaakkkkeeeeccccoooonnnntttteeeexxxxtttt((((3333CCCC))))                                                mmmmaaaakkkkeeeeccccoooonnnntttteeeexxxxtttt((((3333CCCC))))
  71.  
  72.  
  73.  
  74. NOTES
  75.      The size of the _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt______tttt structure may change in future releases.  To
  76.      remain binary compatible, users of these features must always use
  77.      _mmmm_aaaa_kkkk_eeee_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt or _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt to create new instances of them.
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.